#ifndef MEDIAWIKIWINDOW_H
#define MEDIAWIKIWINDOW_H

#include <QKeyEvent>
#include <QTimer>
#include <QWidget>

#include <framelesswidget.h>


class QListWidgetItem;

class Wiki;
namespace Ui {
class MediaWikiWindow;
}

class MediaWikiWindow : public QWidget
{
    Q_OBJECT

public:
    explicit MediaWikiWindow(QWidget *parent = nullptr);
    ~MediaWikiWindow();

    Wiki *get_wiki();
    void reload_mediawiki_search(const QString &text);

    void do1(const QString &arg1);
    void do2();

signals:
    void onMessageSignal(const QString &text);

private slots:
    void on_lineEdit_textChanged(const QString &arg1);
    void on_lineEdit_returnPressed();

    void on_listWidget_currentItemChanged(QListWidgetItem *current, QListWidgetItem *previous);

    void on_comboBox_currentIndexChanged(int index);

    void on_pushButton_clicked();


    void on_btn_restore_clicked();

    void on_MediaWikiWindow_customContextMenuRequested(const QPoint &pos);

    void on_action_config_dataset_triggered();

    void on_frame_customContextMenuRequested(const QPoint &pos);

private:
    Ui::MediaWikiWindow *ui;
    QList<Wiki*> wikis;

    QTimer mediawiki_search_timer;

    // QWidget interface
protected:
    virtual void keyPressEvent(QKeyEvent *event) override;
};

#endif // MEDIAWIKIWINDOW_H
